/*
* @Author: chenggh
* @Date: 2025-06-18
* @Link to Problem : https://oj.haizeix.com/problem/184
*/
#include <iostream>
using namespace std;
int a[100005] = {0};
int main(){
	int n; cin >> n;
	int pos = 1;
	for(int i = 1; i <= n; i++){
		cin >> a[i];
	}
	int ans = 0;
	while(pos <= n){
		pos += a[pos];
		ans++;
	}
	cout << ans << endl;
	return 0;
}